package com.sfexpress.mycatweb.entity.monitor;

import java.io.Serializable;

import org.hyperic.sigar.CpuPerc;

public class CpuStat implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private double used;
	private double idle;
	private double wait;
	private double sys;
	private double user;
	
	public static CpuStat transform(CpuPerc cpuPerc) {
		CpuStat cpuStat = new CpuStat();
		cpuStat.setUsed(cpuPerc.getCombined());
		cpuStat.setIdle(cpuPerc.getIdle());
		cpuStat.setWait(cpuPerc.getWait());
		cpuStat.setSys(cpuPerc.getSys());
		cpuStat.setUser(cpuPerc.getUser());
		return cpuStat;
	}
	
	public double getUsed() {
		return used;
	}
	public void setUsed(double used) {
		this.used = used;
	}
	public double getIdle() {
		return idle;
	}
	public void setIdle(double idle) {
		this.idle = idle;
	}
	public double getWait() {
		return wait;
	}
	public void setWait(double wait) {
		this.wait = wait;
	}
	public double getSys() {
		return sys;
	}
	public void setSys(double sys) {
		this.sys = sys;
	}
	public double getUser() {
		return user;
	}
	public void setUser(double user) {
		this.user = user;
	}
	
}
